home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume10 / ptoc / part08 < prev    next >
Encoding:
Internet Message Format  |  1987-07-27  |  46.6 KB

  1. Path: uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i072:  Pascal to C translator, Part08/12
  5. Message-ID: <723@uunet.UU.NET>
  6. Date: 28 Jul 87 19:36:06 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 1047
  9. Approved: rs@uunet.UU.NET
  10.  
  11. Submitted-by: Per Bergsten <mcvax!enea!chalmers!holtec!perb>
  12. Posting-number: Volume 10, Issue 72
  13. Archive-name: ptoc/Part08
  14.  
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 8 (of 12)."
  23. # Contents:  ptc.c.6
  24. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  25. if test -f 'ptc.c.6' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'ptc.c.6'\"
  27. else
  28. echo shar: Extracting \"'ptc.c.6'\" \(44980 characters\)
  29. sed "s/^X//" >'ptc.c.6' <<'END_OF_FILE'
  30. Xe(dput)) {
  31. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  32. X        (void)fprintf(output.fp, "**    Definitions for i/o\n"), Putl(output, 1);
  33. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  34. X        (void)fprintf(output.fp, "%s<stdio.h>\n", C24_include), Putl(output, 1);
  35. X    }
  36. X    if (use(dinput) || use(doutput) || use(dtext)) {
  37. X        etextdef();
  38. X        if (use(dinput)) {
  39. X            if (tp->U.V13.tsubid == (struct S61 *)NIL)
  40. X                (void)fprintf(output.fp, "%s", xtern), Putl(output, 0);
  41. X            (void)fprintf(output.fp, "text%c", tab1), Putl(output, 0);
  42. X            printid(defnams.A[(int)(dinput)]->U.V6.lid);
  43. X            if (tp->U.V13.tsubid != (struct S61 *)NIL)
  44. X                (void)fprintf(output.fp, " = { stdin, 0, 0 }"), Putl(output, 0);
  45. X            Putchr(';', output),Putchr('\n', output);
  46. X        }
  47. X        if (use(doutput)) {
  48. X            if (tp->U.V13.tsubid == (struct S61 *)NIL)
  49. X                (void)fprintf(output.fp, "%s", xtern), Putl(output, 0);
  50. X            (void)fprintf(output.fp, "text%c", tab1), Putl(output, 0);
  51. X            printid(defnams.A[(int)(doutput)]->U.V6.lid);
  52. X            if (tp->U.V13.tsubid != (struct S61 *)NIL)
  53. X                (void)fprintf(output.fp, " = { stdout, 0, 0 }"), Putl(output, 0);
  54. X            Putchr(';', output),Putchr('\n', output);
  55. X        }
  56. X    }
  57. X    if (use(dinput) || use(dget) || use(dread) || use(dreadln) || use(deof) || use(deoln) || use(dreset) || use(drewrite)) {
  58. X        (void)fprintf(output.fp, "%sFread(x, f) fread((char *)&x, sizeof(x), 1, f)\n", C4_define), Putl(output, 1);
  59. X        (void)fprintf(output.fp, "%sGet(f) Fread((f).buf, (f).fp)\n", C4_define), Putl(output, 1);
  60. X        (void)fprintf(output.fp, "%sGetx(f) (f).init = 1, (f).eoln = (((f).buf = fgetc((f).fp)) == %s) ? (((f).buf = %s), 1) : 0\n", C4_define, nlchr, spchr), Putl(output, 1);
  61. X        (void)fprintf(output.fp, "%sGetchr(f) (f).buf, Getx(f)\n", C4_define), Putl(output, 1);
  62. X    }
  63. X    if (use(dread) || use(dreadln)) {
  64. X        (void)fprintf(output.fp, "%sFILE%c*Tmpfil;\n", C50_static, tab1), Putl(output, 1);
  65. X        (void)fprintf(output.fp, "%slong%cTmplng;\n", C50_static, tab1), Putl(output, 1);
  66. X        (void)fprintf(output.fp, "%sdouble%cTmpdbl;\n", C50_static, tab1), Putl(output, 1);
  67. X        (void)fprintf(output.fp, "%sFscan(f) (f).init ? ungetc((f).buf, (f).fp) : 0, Tmpfil = (f).fp\n", C4_define), Putl(output, 1);
  68. X        (void)fprintf(output.fp, "%sScan(p, a) Scanck(fscanf(Tmpfil, p, a))\n", C4_define), Putl(output, 1);
  69. X        (void)fprintf(output.fp, "%s%cScanck();\n", voidtyp, tab1), Putl(output, 1);
  70. X        if (use(dreadln))
  71. X            (void)fprintf(output.fp, "%s%cGetl();\n", voidtyp, tab1), Putl(output, 1);
  72. X    }
  73. X    if (use(deoln))
  74. X        (void)fprintf(output.fp, "%sEoln(f) ((f).eoln ? true : false)\n", C4_define), Putl(output, 1);
  75. X    if (use(deof))
  76. X        (void)fprintf(output.fp, "%sEof(f) ((((f).init == 0) ? (Get(f)) : 0, ((f).eof ? 1 : feof((f).fp))) ? true : false)\n", C4_define), Putl(output, 1);
  77. X    if (use(doutput) || use(dput) || use(dwrite) || use(dwriteln) || use(dreset) || use(drewrite) || use(dclose)) {
  78. X        (void)fprintf(output.fp, "%sFwrite(x, f) fwrite((char *)&x, sizeof(x), 1, f)\n", C4_define), Putl(output, 1);
  79. X        (void)fprintf(output.fp, "%sPut(f) Fwrite((f).buf, (f).fp)\n", C4_define), Putl(output, 1);
  80. X        (void)fprintf(output.fp, "%sPutx(f) (f).eoln = ((f).buf == %s), %sfputc((f).buf, (f).fp)\n", C4_define, nlchr, voidcast), Putl(output, 1);
  81. X        (void)fprintf(output.fp, "%sPutchr(c, f) (f).buf = (c), Putx(f)\n", C4_define), Putl(output, 1);
  82. X        (void)fprintf(output.fp, "%sPutl(f, v) (f).eoln = v\n", C4_define), Putl(output, 1);
  83. X    }
  84. X    if (use(dreset) || use(drewrite) || use(dclose))
  85. X        (void)fprintf(output.fp, "%sFinish(f) ((f).out && !(f).eoln) ? (Putchr(%s, f), 0) : 0, rewind((f).fp)\n", C4_define, nlchr), Putl(output, 1);
  86. X    if (use(dclose)) {
  87. X        (void)fprintf(output.fp, "%sClose(f) (f).init = ((f).init ? (fclose((f).fp), 0) : 0), (f).fp = NULL\n", C4_define), Putl(output, 1);
  88. X        (void)fprintf(output.fp, "%sClosex(f) (f).init = ((f).init ? (Finish(f), fclose((f).fp), 0) : 0), (f).fp = NULL\n", C4_define), Putl(output, 1);
  89. X    }
  90. X    if (use(dreset)) {
  91. X        (void)fprintf(output.fp, "%sREADONLY\n", ifdef), Putl(output, 1);
  92. X        (void)fprintf(output.fp, "%s%s%cRmode[] = \"r\";\n", C50_static, chartyp, tab1), Putl(output, 1);
  93. X        (void)fprintf(output.fp, "%s\n", elsif), Putl(output, 1);
  94. X        (void)fprintf(output.fp, "%s%s%cRmode[] = \"r+\";\n", C50_static, chartyp, tab1), Putl(output, 1);
  95. X        (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  96. X        (void)fprintf(output.fp, "%sReset(f, n) (f).init = (f).init ? rewind((f).fp) : (((f).fp = Fopen(n, Rmode)), 1), (f).eof = (f).out = 0, Get(f)\n", C4_define), Putl(output, 1);
  97. X        (void)fprintf(output.fp, "%sResetx(f, n) (f).init = (f).init ? (Finish(f)) : (((f).fp = Fopen(n, Rmode)), 1), (f).eof = (f).out = 0, Getx(f)\n", C4_define), Putl(output, 1);
  98. X        usefopn = true;
  99. X    }
  100. X    if (use(drewrite)) {
  101. X        (void)fprintf(output.fp, "%sWRITEONLY\n", ifdef), Putl(output, 1);
  102. X        (void)fprintf(output.fp, "%s%s%cWmode[] = \"w\";\n", C50_static, chartyp, tab1), Putl(output, 1);
  103. X        (void)fprintf(output.fp, "%s\n", elsif), Putl(output, 1);
  104. X        (void)fprintf(output.fp, "%s%s%cWmode[] = \"w+\";\n", C50_static, chartyp, tab1), Putl(output, 1);
  105. X        (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  106. X        (void)fprintf(output.fp, "%sRewrite(f, n) (f).init = (f).init ? rewind((f).fp) : (((f).fp = Fopen(n, Wmode)), 1), (f).out = (f).eof = 1\n", C4_define), Putl(output, 1);
  107. X        (void)fprintf(output.fp, "%sRewritex(f, n) (f).init = (f).init ? (Finish(f)) : (((f).fp = Fopen(n, Wmode)), 1), (f).out = (f).eof = (f).eoln = 1\n", C4_define), Putl(output, 1);
  108. X        usefopn = true;
  109. X    }
  110. X    if (usefopn) {
  111. X        (void)fprintf(output.fp, "FILE    *Fopen();\n"), Putl(output, 1);
  112. X        (void)fprintf(output.fp, "%sMAXFILENAME 256\n", C4_define), Putl(output, 1);
  113. X    }
  114. X    if (usecase || usejmps) {
  115. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  116. X        (void)fprintf(output.fp, "**    Definitions for case-statements\n"), Putl(output, 1);
  117. X        (void)fprintf(output.fp, "**    and for non-local gotos\n"), Putl(output, 1);
  118. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  119. X        (void)fprintf(output.fp, "%sLine __LINE__\n", C4_define), Putl(output, 1);
  120. X        (void)fprintf(output.fp, "%s%cCaseerror();\n", voidtyp, tab1), Putl(output, 1);
  121. X    }
  122. X    if (usejmps) {
  123. X        (void)fprintf(output.fp, "%s<setjmp.h>\n", C24_include), Putl(output, 1);
  124. X        (void)fprintf(output.fp, "%sstruct Jb { jmp_buf%cjb; } J[%1d];\n", C50_static, tab1, (maxlevel + 1)), Putl(output, 1);
  125. X    }
  126. X    if (use(dinteger) || use(dmaxint) || use(dboolean) || use(dfalse) || use(dtrue) || use(deof) || use(deoln) || use(dexp) || use(dln) || use(dsqr) || use(dsin) || use(dcos) || use(dtan) || use(darctan) || use(dsqrt) || use(dreal)) {
  127. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  128. X        (void)fprintf(output.fp, "**    Definitions for standard types\n"), Putl(output, 1);
  129. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  130. X    }
  131. X    if (usecomp) {
  132. X        (void)fprintf(output.fp, "%s%s strncmp();\n", xtern, inttyp), Putl(output, 1);
  133. X        (void)fprintf(output.fp, "%sCmpstr(x, y) strncmp((x), (y), sizeof(x))\n", C4_define), Putl(output, 1);
  134. X    }
  135. X    if (use(dboolean) || use(dfalse) || use(dtrue) || use(deof) || use(deoln) || usesets) {
  136. X        capital(defnams.A[(int)(dboolean)]);
  137. X        (void)fprintf(output.fp, "%s%s%c", typdef, chartyp, tab1), Putl(output, 0);
  138. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  139. X        Putchr(';', output),Putchr('\n', output);
  140. X        capital(defnams.A[(int)(dfalse)]);
  141. X        (void)fprintf(output.fp, "%s", C4_define), Putl(output, 0);
  142. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  143. X        (void)fprintf(output.fp, " ("), Putl(output, 0);
  144. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  145. X        (void)fprintf(output.fp, ")0\n"), Putl(output, 1);
  146. X        capital(defnams.A[(int)(dtrue)]);
  147. X        (void)fprintf(output.fp, "%s", C4_define), Putl(output, 0);
  148. X        printid(defnams.A[(int)(dtrue)]->U.V6.lid);
  149. X        (void)fprintf(output.fp, " ("), Putl(output, 0);
  150. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  151. X        (void)fprintf(output.fp, ")1\n"), Putl(output, 1);
  152. X        (void)fprintf(output.fp, "%s%s%c*Bools[];\n", xtern, chartyp, tab1), Putl(output, 1);
  153. X    }
  154. X    capital(defnams.A[(int)(dinteger)]);
  155. X    if (use(dinteger)) {
  156. X        (void)fprintf(output.fp, "%s%s%c", typdef, inttyp, tab1), Putl(output, 0);
  157. X        printid(defnams.A[(int)(dinteger)]->U.V6.lid);
  158. X        Putchr(';', output),Putchr('\n', output);
  159. X    }
  160. X    if (use(dmaxint))
  161. X        (void)fprintf(output.fp, "%smaxint%c%1d\n", C4_define, tab1, maxint), Putl(output, 1);
  162. X    capital(defnams.A[(int)(dreal)]);
  163. X    if (use(dreal)) {
  164. X        (void)fprintf(output.fp, "%s%s%c", typdef, realtyp, tab1), Putl(output, 0);
  165. X        printid(defnams.A[(int)(dreal)]->U.V6.lid);
  166. X        Putchr(';', output),Putchr('\n', output);
  167. X    }
  168. X    if (use(dexp))
  169. X        (void)fprintf(output.fp, "%s%s exp();\n", xtern, doubletyp), Putl(output, 1);
  170. X    if (use(dln))
  171. X        (void)fprintf(output.fp, "%s%s log();\n", xtern, doubletyp), Putl(output, 1);
  172. X    if (use(dsqr))
  173. X        (void)fprintf(output.fp, "%s%s pow();\n", xtern, doubletyp), Putl(output, 1);
  174. X    if (use(dsin))
  175. X        (void)fprintf(output.fp, "%s%s sin();\n", xtern, doubletyp), Putl(output, 1);
  176. X    if (use(dcos))
  177. X        (void)fprintf(output.fp, "%s%s cos();\n", xtern, doubletyp), Putl(output, 1);
  178. X    if (use(dtan))
  179. X        (void)fprintf(output.fp, "%s%s tan();\n", xtern, doubletyp), Putl(output, 1);
  180. X    if (use(darctan))
  181. X        (void)fprintf(output.fp, "%s%s atan();\n", xtern, doubletyp), Putl(output, 1);
  182. X    if (use(dsqrt))
  183. X        (void)fprintf(output.fp, "%s%s sqrt();\n", xtern, doubletyp), Putl(output, 1);
  184. X    if (use(dabs) && use(dreal))
  185. X        (void)fprintf(output.fp, "%s%s fabs();\n", xtern, doubletyp), Putl(output, 1);
  186. X    if (use(dhalt))
  187. X        (void)fprintf(output.fp, "%s%s abort();\n", xtern, voidtyp), Putl(output, 1);
  188. X    if (use(dnew) || usenilp) {
  189. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  190. X        (void)fprintf(output.fp, "**    Definitions for pointers\n"), Putl(output, 1);
  191. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  192. X    }
  193. X    if (use(dnew)) {
  194. X        (void)fprintf(output.fp, "%sUnionoffs\n", ifndef), Putl(output, 1);
  195. X        (void)fprintf(output.fp, "%sUnionoffs(p, m) (((long)(&(p)->m))-((long)(p)))\n", C4_define), Putl(output, 1);
  196. X        (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  197. X    }
  198. X    if (usenilp)
  199. X        (void)fprintf(output.fp, "%sNIL 0\n", C4_define), Putl(output, 1);
  200. X    if (use(dnew))
  201. X        (void)fprintf(output.fp, "%s%s *malloc();\n", xtern, chartyp), Putl(output, 1);
  202. X    if (use(ddispose))
  203. X        (void)fprintf(output.fp, "%s%s free();\n", xtern, voidtyp), Putl(output, 1);
  204. X    if (usesets) {
  205. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  206. X        (void)fprintf(output.fp, "**    Definitions for set-operations\n"), Putl(output, 1);
  207. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  208. X        (void)fprintf(output.fp, "%sClaimset() %sCurrset(0, (%s)0)\n", C4_define, voidcast, setptyp), Putl(output, 1);
  209. X        (void)fprintf(output.fp, "%sNewset() Currset(1, (%s)0)\n", C4_define, setptyp), Putl(output, 1);
  210. X        (void)fprintf(output.fp, "%sSaveset(s) Currset(2, s)\n", C4_define), Putl(output, 1);
  211. X        (void)fprintf(output.fp, "%ssetbits %1d\n", C4_define, C37_setbits), Putl(output, 1);
  212. X        (void)fprintf(output.fp, "%s%s%c%s;\n", typdef, wordtype, tab1, setwtyp), Putl(output, 1);
  213. X        (void)fprintf(output.fp, "%s%s *%c%s;\n", typdef, setwtyp, tab1, setptyp), Putl(output, 1);
  214. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  215. X        (void)fprintf(output.fp, "%cMember(), Le(), Ge(), Eq(), Ne();\n", tab1), Putl(output, 1);
  216. X        (void)fprintf(output.fp, "%s%cUnion(), Diff();\n", setptyp, tab1), Putl(output, 1);
  217. X        (void)fprintf(output.fp, "%s%cInsmem(), Mksubr();\n", setptyp, tab1), Putl(output, 1);
  218. X        (void)fprintf(output.fp, "%s%cCurrset(), Inter();\n", setptyp, tab1), Putl(output, 1);
  219. X        (void)fprintf(output.fp, "%s%s%cTmpset;\n", C50_static, setptyp, tab1), Putl(output, 1);
  220. X        (void)fprintf(output.fp, "%s%s%cConset[];\n", xtern, setptyp, tab1), Putl(output, 1);
  221. X        (void)fprintf(output.fp, "%s%cSetncpy();\n", voidtyp, tab1), Putl(output, 1);
  222. X    }
  223. X    (void)fprintf(output.fp, "%s%s *strncpy();\n", xtern, chartyp), Putl(output, 1);
  224. X    if (use(dargc) || use(dargv)) {
  225. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  226. X        (void)fprintf(output.fp, "**    Definitions for argv-operations\n"), Putl(output, 1);
  227. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  228. X        (void)fprintf(output.fp, "%s%cargc;\n", inttyp, tab1), Putl(output, 1);
  229. X        (void)fprintf(output.fp, "%s%c**argv;\n", chartyp, tab1), Putl(output, 1);
  230. X        (void)fprintf(output.fp, " void\n"), Putl(output, 1);
  231. X        (void)fprintf(output.fp, "Argvgt(n, cp, l)\n"), Putl(output, 1);
  232. X        (void)fprintf(output.fp, "%s%cn;\n", inttyp, tab1), Putl(output, 1);
  233. X        (void)fprintf(output.fp, "%s%s%cl;\n", registr, inttyp, tab1), Putl(output, 1);
  234. X        (void)fprintf(output.fp, "%s%s%c*cp;\n", registr, chartyp, tab1), Putl(output, 1);
  235. X        Putchr('{', output),Putchr('\n', output);
  236. X        (void)fprintf(output.fp, "%c%s%s%c*sp;\n", tab1, registr, chartyp, tab1), Putl(output, 1);
  237. X        Putchr('\n', output);
  238. X        (void)fprintf(output.fp, "%cfor (sp = argv[n]; l > 0 && *sp; l--)\n", tab1), Putl(output, 1);
  239. X        (void)fprintf(output.fp, "%s*cp++ = *sp++;\n", tab2), Putl(output, 1);
  240. X        (void)fprintf(output.fp, "%cwhile (l-- > 0)\n", tab1), Putl(output, 1);
  241. X        (void)fprintf(output.fp, "%s*cp++ = %s;\n", tab2, spchr), Putl(output, 1);
  242. X        Putchr('}', output),Putchr('\n', output);
  243. X    }
  244. X    if ((tp->U.V13.tsubconst != (struct S61 *)NIL) || (tp->U.V13.tsubtype != (struct S61 *)NIL) || (tp->U.V13.tsubvar != (struct S61 *)NIL) || (tp->U.V13.tsubsub != (struct S61 *)NIL)) {
  245. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  246. X        (void)fprintf(output.fp, "**    Start of program definitions\n"), Putl(output, 1);
  247. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  248. X    }
  249. X    econst(tp->U.V13.tsubconst);
  250. X    etype(tp->U.V13.tsubtype);
  251. X    evar(tp->U.V13.tsubvar);
  252. X    if (tp->U.V13.tsubsub != (struct S61 *)NIL)
  253. X        Putchr('\n', output);
  254. X    esubr(tp->U.V13.tsubsub);
  255. X    if (tp->U.V13.tsubid != (struct S61 *)NIL) {
  256. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  257. X        (void)fprintf(output.fp, "**    Start of program code\n"), Putl(output, 1);
  258. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  259. X        if (use(dargc) || use(dargv)) {
  260. X            (void)fprintf(output.fp, "main(_ac, _av)\n"), Putl(output, 1);
  261. X            (void)fprintf(output.fp, "%s%c_ac;\n", inttyp, tab1), Putl(output, 1);
  262. X            (void)fprintf(output.fp, "%s%c*_av[];\n", chartyp, tab1), Putl(output, 1);
  263. X            Putchr('{', output),Putchr('\n', output);
  264. X            Putchr('\n', output);
  265. X            (void)fprintf(output.fp, "%cargc = _ac;\n", tab1), Putl(output, 1);
  266. X            (void)fprintf(output.fp, "%cargv = _av;\n", tab1), Putl(output, 1);
  267. X        } else {
  268. X            (void)fprintf(output.fp, "main()\n"), Putl(output, 1);
  269. X            Putchr('{', output),Putchr('\n', output);
  270. X        }
  271. X        increment();
  272. X        elabel(tp);
  273. X        estmt(tp->U.V13.tsubstmt);
  274. X        indent();
  275. X        (void)fprintf(output.fp, "exit(0);\n"), Putl(output, 1);
  276. X        decrement();
  277. X        Putchr('}', output),Putchr('\n', output);
  278. X        (void)fprintf(output.fp, "/*\n"), Putl(output, 1);
  279. X        (void)fprintf(output.fp, "**    End of program code\n"), Putl(output, 1);
  280. X        (void)fprintf(output.fp, "*/\n"), Putl(output, 1);
  281. X    }
  282. X}
  283. X
  284. Xvoid econset();
  285. X
  286. X integer
  287. Xsize(tp)
  288. X    treeptr    tp;
  289. X{
  290. X    register integer    R175;
  291. X    integer    r, x;
  292. X
  293. X    r = 0;
  294. X    while (tp != (struct S61 *)NIL) {
  295. X        if (tp->tt == nrange)
  296. X            x = cvalof(tp->U.V41.texpr);
  297. X        else
  298. X            if (tp->tt == nempty)
  299. X                x = 0;
  300. X            else
  301. X                x = cvalof(tp);
  302. X        if (x > r)
  303. X            r = x;
  304. X        tp = tp->tnext;
  305. X    }
  306. X    R175 = csetwords(r + 1);
  307. X    return R175;
  308. X}
  309. X
  310. Xvoid ebits();
  311. X
  312. X void
  313. Xeword(s)
  314. X    bitset    s;
  315. X{
  316. X# define bitshex 4
  317. X    integer    n;
  318. X    register integer    i;
  319. X    unsigned char    x;
  320. X
  321. X    n = 0;
  322. X    while (n <= C37_setbits)
  323. X        n = n + bitshex;
  324. X    n = n - bitshex;
  325. X    while (n >= 0) {
  326. X        x = 0;
  327. X        {
  328. X            integer    B57 = 0,
  329. X                B58 = bitshex - 1;
  330. X
  331. X            if (B57 <= B58)
  332. X                for (i = B57; ; i++) {
  333. X                    if (Member((unsigned)((n + i)), s.S))
  334. X                        switch (i) {
  335. X                          case 0:
  336. X                            x = x + 1;
  337. X                            break ;
  338. X                          case 1:
  339. X                            x = x + 2;
  340. X                            break ;
  341. X                          case 2:
  342. X                            x = x + 4;
  343. X                            break ;
  344. X                          case 3:
  345. X                            x = x + 8;
  346. X                            break ;
  347. X                          default:
  348. X                            Caseerror(Line);
  349. X                        }
  350. X                    if (i == B58) break;
  351. X                }
  352. X        }
  353. X        Putchr(hexdig.A[x], output);
  354. X        n = n - bitshex;
  355. X    }
  356. X}
  357. X
  358. X void
  359. Xebits(tp)
  360. X    treeptr    tp;
  361. X{
  362. X    typedef struct { bitset    A[maxsetrange + 1]; }    T74;
  363. X    T74    sets;
  364. X    integer    s;
  365. X    register integer    m;
  366. X    register integer    n;
  367. X
  368. X    s = size(tp);
  369. X    {
  370. X        integer    B59 = 0,
  371. X            B60 = s - 1;
  372. X
  373. X        if (B59 <= B60)
  374. X            for (n = B59; ; n++) {
  375. X                Setncpy(sets.A[n].S, Conset[161], sizeof(sets.A[n].S));
  376. X                if (n == B60) break;
  377. X            }
  378. X    }
  379. X    while (tp != (struct S61 *)NIL) {
  380. X        if (tp->tt == nrange)
  381. X            {
  382. X                integer    B61 = cvalof(tp->U.V41.texpl),
  383. X                    B62 = cvalof(tp->U.V41.texpr);
  384. X
  385. X                if (B61 <= B62)
  386. X                    for (m = B61; ; m++) {
  387. X                        n = m / (C37_setbits + 1);
  388. X                        Setncpy(sets.A[n].S, Union(sets.A[n].S, Saveset((Tmpset = Newset(), (void)Insmem((unsigned)(m % (C37_setbits + 1)), Tmpset), Tmpset))), sizeof(sets.A[n].S));
  389. X                        Claimset();
  390. X                        if (m == B62) break;
  391. X                    }
  392. X            }
  393. X        else
  394. X            if (tp->tt != nempty) {
  395. X                m = cvalof(tp);
  396. X                n = m / (C37_setbits + 1);
  397. X                Setncpy(sets.A[n].S, Union(sets.A[n].S, Saveset((Tmpset = Newset(), (void)Insmem((unsigned)(m % (C37_setbits + 1)), Tmpset), Tmpset))), sizeof(sets.A[n].S));
  398. X                Claimset();
  399. X            }
  400. X        tp = tp->tnext;
  401. X    }
  402. X    (void)fprintf(output.fp, "%c%1d", tab1, s), Putl(output, 0);
  403. X    {
  404. X        integer    B63 = 0,
  405. X            B64 = s - 1;
  406. X
  407. X        if (B63 <= B64)
  408. X            for (n = B63; ; n++) {
  409. X                Putchr(',', output);
  410. X                if (n % 6 == 0)
  411. X                    Putchr('\n', output);
  412. X                (void)fprintf(output.fp, "%c0x", tab1), Putl(output, 0);
  413. X                eword(sets.A[n]);
  414. X                if (n == B64) break;
  415. X            }
  416. X    }
  417. X    Putchr('\n', output);
  418. X}
  419. X
  420. X void
  421. Xeconset(tp, len)
  422. X    treeptr    tp;
  423. X    integer    len;
  424. X{
  425. X    register integer    i;
  426. X
  427. X    i = 0;
  428. X    while (tp != (struct S61 *)NIL) {
  429. X        (void)fprintf(output.fp, "%s%s%cQ%1d[] = {\n", C50_static, setwtyp, tab1, i), Putl(output, 1);
  430. X        ebits(tp->U.V42.texps);
  431. X        (void)fprintf(output.fp, "};\n"), Putl(output, 1);
  432. X        i = i + 1;
  433. X        tp = tp->tnext;
  434. X    }
  435. X    (void)fprintf(output.fp, "%s%s%c*Conset[] = {\n", C50_static, setwtyp, tab1), Putl(output, 1);
  436. X    {
  437. X        integer    B65 = len - 1,
  438. X            B66 = 1;
  439. X
  440. X        if (B65 >= B66)
  441. X            for (i = B65; ; i--) {
  442. X                (void)fprintf(output.fp, "%cQ%1d,", tab1, i), Putl(output, 0);
  443. X                if (i % 6 == 5)
  444. X                    Putchr('\n', output);
  445. X                if (i == B66) break;
  446. X            }
  447. X    }
  448. X    (void)fprintf(output.fp, "%cQ0\n", tab1), Putl(output, 1);
  449. X    (void)fprintf(output.fp, "};\n"), Putl(output, 1);
  450. X}
  451. X
  452. X void
  453. Xemit()
  454. X{
  455. X    static char    usigned[]    = "unsigned ";
  456. X    boolean    conflag, setused, dropset, donearr;
  457. X    integer    doarrow, indnt;
  458. X    boolean    *F195;
  459. X    boolean    *F197;
  460. X    boolean    *F199;
  461. X    boolean    *F201;
  462. X    integer    *F203;
  463. X    integer    *F205;
  464. X
  465. X    F205 = G204_indnt;
  466. X    G204_indnt = &indnt;
  467. X    F203 = G202_doarrow;
  468. X    G202_doarrow = &doarrow;
  469. X    F201 = G200_donearr;
  470. X    G200_donearr = &donearr;
  471. X    F199 = G198_dropset;
  472. X    G198_dropset = &dropset;
  473. X    F197 = G196_setused;
  474. X    G196_setused = &setused;
  475. X    F195 = G194_conflag;
  476. X    G194_conflag = &conflag;
  477. X    (*G204_indnt) = 0;
  478. X    varno = 0;
  479. X    (*G194_conflag) = false;
  480. X    (*G196_setused) = false;
  481. X    (*G198_dropset) = false;
  482. X    (*G202_doarrow) = 0;
  483. X    eprogram(top);
  484. X    if (usebool)
  485. X        (void)fprintf(output.fp, "%s%c*Bools[] = { \"false\", \"true\" };\n", chartyp, tab1), Putl(output, 1);
  486. X    if (usescan) {
  487. X        Putchr('\n', output);
  488. X        (void)fprintf(output.fp, "%s%s\n", C50_static, voidtyp), Putl(output, 1);
  489. X        (void)fprintf(output.fp, "Scanck(n)\n"), Putl(output, 1);
  490. X        (void)fprintf(output.fp, "%s%cn;\n", inttyp, tab1), Putl(output, 1);
  491. X        Putchr('{', output),Putchr('\n', output);
  492. X        (void)fprintf(output.fp, "%cif (n != 1) {\n", tab1), Putl(output, 1);
  493. X        (void)fprintf(output.fp, "%s%sfprintf(stderr, \"Bad input\\n\");\n", tab2, voidcast), Putl(output, 1);
  494. X        (void)fprintf(output.fp, "%sexit(1);\n", tab2), Putl(output, 1);
  495. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  496. X        Putchr('}', output),Putchr('\n', output);
  497. X    }
  498. X    if (usegetl) {
  499. X        Putchr('\n', output);
  500. X        (void)fprintf(output.fp, "%s%s\n", C50_static, voidtyp), Putl(output, 1);
  501. X        (void)fprintf(output.fp, "Getl(f)\n"), Putl(output, 1);
  502. X        (void)fprintf(output.fp, " text%c*f;\n", tab1), Putl(output, 1);
  503. X        Putchr('{', output),Putchr('\n', output);
  504. X        (void)fprintf(output.fp, "%cwhile (f->eoln == 0)\n", tab1), Putl(output, 1);
  505. X        (void)fprintf(output.fp, "%sGetx(*f);\n", tab2), Putl(output, 1);
  506. X        (void)fprintf(output.fp, "%cGetx(*f);\n", tab1), Putl(output, 1);
  507. X        Putchr('}', output),Putchr('\n', output);
  508. X    }
  509. X    if (usefopn) {
  510. X        Putchr('\n', output);
  511. X        (void)fprintf(output.fp, "%sFILE *\n", C50_static), Putl(output, 1);
  512. X        (void)fprintf(output.fp, "Fopen(n, m)\n"), Putl(output, 1);
  513. X        (void)fprintf(output.fp, "%s%c*n, *m;\n", chartyp, tab1), Putl(output, 1);
  514. X        Putchr('{', output),Putchr('\n', output);
  515. X        (void)fprintf(output.fp, "%cFILE%s*f;\n", tab1, tab2), Putl(output, 1);
  516. X        (void)fprintf(output.fp, "%c%s%s%c*s;\n", tab1, registr, chartyp, tab1), Putl(output, 1);
  517. X        (void)fprintf(output.fp, "%c%s%s%cch = %cA%c;\n", tab1, C50_static, chartyp, tab1, quote, quote), Putl(output, 1);
  518. X        (void)fprintf(output.fp, "%c%s%s%ctmp[MAXFILENAME];\n", tab1, C50_static, chartyp, tab1), Putl(output, 1);
  519. X        (void)fprintf(output.fp, "%c%s%s%cunlink();\n", tab1, xtern, inttyp, tab1), Putl(output, 1);
  520. X        Putchr('\n', output);
  521. X        (void)fprintf(output.fp, "%cif (n == NULL)\n", tab1), Putl(output, 1);
  522. X        (void)fprintf(output.fp, "%ssprintf(tmp, %sch++);\n", tab2, tmpfilename), Putl(output, 1);
  523. X        (void)fprintf(output.fp, "%celse {\n", tab1), Putl(output, 1);
  524. X        (void)fprintf(output.fp, "%sstrncpy(tmp, n, sizeof(tmp));\n", tab2), Putl(output, 1);
  525. X        (void)fprintf(output.fp, "%sfor (s = &tmp[sizeof(tmp)-1]; *s == %s || *s == %s; )\n", tab2, spchr, nulchr), Putl(output, 1);
  526. X        (void)fprintf(output.fp, "%s*s-- = %s;\n", tab3, nulchr), Putl(output, 1);
  527. X        (void)fprintf(output.fp, "%sif (tmp[sizeof(tmp)-1]) {\n", tab2), Putl(output, 1);
  528. X        (void)fprintf(output.fp, "%s%sfprintf(stderr, \"Too long filename %c%%s%c\\n\", n);\n", tab3, voidcast, quote, quote), Putl(output, 1);
  529. X        (void)fprintf(output.fp, "%sexit(1);\n", tab3), Putl(output, 1);
  530. X        (void)fprintf(output.fp, "%s}\n", tab2), Putl(output, 1);
  531. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  532. X        (void)fprintf(output.fp, "%cs = tmp;\n", tab1), Putl(output, 1);
  533. X        (void)fprintf(output.fp, "%cif ((f = fopen(s, m)) == NULL) {\n", tab1), Putl(output, 1);
  534. X        (void)fprintf(output.fp, "%s%sfprintf(stderr, \"Cannot open: %%s\\n\", s);\n", tab2, voidcast), Putl(output, 1);
  535. X        (void)fprintf(output.fp, "%sexit(1);\n", tab2), Putl(output, 1);
  536. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  537. X        (void)fprintf(output.fp, "%cif (n == NULL)\n", tab1), Putl(output, 1);
  538. X        (void)fprintf(output.fp, "%sunlink(tmp);\n", tab2), Putl(output, 1);
  539. X        (void)fprintf(output.fp, "%creturn (f);\n", tab1), Putl(output, 1);
  540. X        Putchr('}', output),Putchr('\n', output);
  541. X        (void)fprintf(output.fp, "%s%s%crewind();\n", xtern, inttyp, tab1), Putl(output, 1);
  542. X    }
  543. X    if (setcnt > 0)
  544. X        econset(setlst, setcnt);
  545. X    if (useunion) {
  546. X        Putchr('\n', output);
  547. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  548. X        (void)fprintf(output.fp, "Union(p1, p2)\n"), Putl(output, 1);
  549. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  550. X        Putchr('{', output),Putchr('\n', output);
  551. X        (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  552. X        (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  553. X        (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  554. X        Putchr('\n', output);
  555. X        (void)fprintf(output.fp, "%cj = *p1;\n", tab1), Putl(output, 1);
  556. X        (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  557. X        (void)fprintf(output.fp, "%cif (j > *p2)\n", tab1), Putl(output, 1);
  558. X        (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  559. X        (void)fprintf(output.fp, "%celse\n", tab1), Putl(output, 1);
  560. X        (void)fprintf(output.fp, "%s*p3 = *p2;\n", tab2), Putl(output, 1);
  561. X        (void)fprintf(output.fp, "%ck = *p1 - *p2;\n", tab1), Putl(output, 1);
  562. X        (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  563. X        (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  564. X        (void)fprintf(output.fp, "%s*p3++ = (*p1++ | *p2++);\n", tab2), Putl(output, 1);
  565. X        (void)fprintf(output.fp, "%cwhile (k > 0) {\n", tab1), Putl(output, 1);
  566. X        (void)fprintf(output.fp, "%s*p3++ = *p1++;\n", tab2), Putl(output, 1);
  567. X        (void)fprintf(output.fp, "%sk--;\n", tab2), Putl(output, 1);
  568. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  569. X        (void)fprintf(output.fp, "%cwhile (k < 0) {\n", tab1), Putl(output, 1);
  570. X        (void)fprintf(output.fp, "%s*p3++ = *p2++;\n", tab2), Putl(output, 1);
  571. X        (void)fprintf(output.fp, "%sk++;\n", tab2), Putl(output, 1);
  572. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  573. X        (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  574. X        Putchr('}', output),Putchr('\n', output);
  575. X    }
  576. X    if (usediff) {
  577. X        Putchr('\n', output);
  578. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  579. X        (void)fprintf(output.fp, "Diff(p1, p2)\n"), Putl(output, 1);
  580. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  581. X        Putchr('{', output),Putchr('\n', output);
  582. X        (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  583. X        (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  584. X        (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  585. X        Putchr('\n', output);
  586. X        (void)fprintf(output.fp, "%cj = *p1;\n", tab1), Putl(output, 1);
  587. X        (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  588. X        (void)fprintf(output.fp, "%cif (j > *p2)\n", tab1), Putl(output, 1);
  589. X        (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  590. X        (void)fprintf(output.fp, "%ck = *p1 - *p2;\n", tab1), Putl(output, 1);
  591. X        (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  592. X        (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  593. X        (void)fprintf(output.fp, "%s*p3++ = (*p1++ & ~ (*p2++));\n", tab2), Putl(output, 1);
  594. X        (void)fprintf(output.fp, "%cwhile (k > 0) {\n", tab1), Putl(output, 1);
  595. X        (void)fprintf(output.fp, "%s*p3++ = *p1++;\n", tab2), Putl(output, 1);
  596. X        (void)fprintf(output.fp, "%sk--;\n", tab2), Putl(output, 1);
  597. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  598. X        (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  599. X        Putchr('}', output),Putchr('\n', output);
  600. X    }
  601. X    if (useintr) {
  602. X        Putchr('\n', output);
  603. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  604. X        (void)fprintf(output.fp, "Inter(p1, p2)\n"), Putl(output, 1);
  605. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  606. X        Putchr('{', output),Putchr('\n', output);
  607. X        (void)fprintf(output.fp, "%c%s%s%si, j, k;\n", tab1, registr, inttyp, tab2), Putl(output, 1);
  608. X        (void)fprintf(output.fp, "%c%s%s%ssp = Newset(),\n", tab1, registr, setptyp, tab2), Putl(output, 1);
  609. X        (void)fprintf(output.fp, "%sp3 = sp;\n", tab4), Putl(output, 1);
  610. X        Putchr('\n', output);
  611. X        (void)fprintf(output.fp, "%cif ((j = *p1) > *p2)\n", tab1), Putl(output, 1);
  612. X        (void)fprintf(output.fp, "%sj = *p2;\n", tab2), Putl(output, 1);
  613. X        (void)fprintf(output.fp, "%c*p3 = j;\n", tab1), Putl(output, 1);
  614. X        (void)fprintf(output.fp, "%cp1++, p2++, p3++;\n", tab1), Putl(output, 1);
  615. X        (void)fprintf(output.fp, "%cfor (i = 0; i < j; i++)\n", tab1), Putl(output, 1);
  616. X        (void)fprintf(output.fp, "%s*p3++ = (*p1++ & *p2++);\n", tab2), Putl(output, 1);
  617. X        (void)fprintf(output.fp, "%creturn (Saveset(sp));\n", tab1), Putl(output, 1);
  618. X        Putchr('}', output),Putchr('\n', output);
  619. X    }
  620. X    if (usememb) {
  621. X        Putchr('\n', output);
  622. X        (void)fprintf(output.fp, "%s", C50_static), Putl(output, 0);
  623. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  624. X        Putchr('\n', output);
  625. X        (void)fprintf(output.fp, "Member(m, sp)\n"), Putl(output, 1);
  626. X        (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  627. X        (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  628. X        Putchr('{', output),Putchr('\n', output);
  629. X        (void)fprintf(output.fp, "%c%s%s%s%ci = m / (setbits+1) + 1;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  630. X        Putchr('\n', output);
  631. X        (void)fprintf(output.fp, "%cif ((i <= *sp) && (sp[i] & (1 << (m %% (setbits+1)))))\n", tab1), Putl(output, 1);
  632. X        (void)fprintf(output.fp, "%sreturn (", tab2), Putl(output, 0);
  633. X        printid(defnams.A[(int)(dtrue)]->U.V6.lid);
  634. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  635. X        (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  636. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  637. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  638. X        Putchr('}', output),Putchr('\n', output);
  639. X    }
  640. X    if (useseq || usesne) {
  641. X        Putchr('\n', output);
  642. X        (void)fprintf(output.fp, "%s", C50_static), Putl(output, 0);
  643. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  644. X        Putchr('\n', output);
  645. X        (void)fprintf(output.fp, "Eq(p1, p2)\n"), Putl(output, 1);
  646. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  647. X        Putchr('{', output),Putchr('\n', output);
  648. X        (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  649. X        Putchr('\n', output);
  650. X        (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  651. X        (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  652. X        (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  653. X        (void)fprintf(output.fp, "%sif (*p1++ != *p2++)\n", tab2), Putl(output, 1);
  654. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  655. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  656. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  657. X        (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  658. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  659. X        (void)fprintf(output.fp, "%cwhile (i != 0) {\n", tab1), Putl(output, 1);
  660. X        (void)fprintf(output.fp, "%sif (*p1++ != 0)\n", tab2), Putl(output, 1);
  661. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  662. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  663. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  664. X        (void)fprintf(output.fp, "%si--;\n", tab2), Putl(output, 1);
  665. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  666. X        (void)fprintf(output.fp, "%cwhile (j != 0) {\n", tab1), Putl(output, 1);
  667. X        (void)fprintf(output.fp, "%sif (*p2++ != 0)\n", tab2), Putl(output, 1);
  668. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  669. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  670. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  671. X        (void)fprintf(output.fp, "%sj--;\n", tab2), Putl(output, 1);
  672. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  673. X        (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  674. X        printid(defnams.A[(int)(dtrue)]->U.V6.lid);
  675. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  676. X        Putchr('}', output),Putchr('\n', output);
  677. X    }
  678. X    if (usesne) {
  679. X        Putchr('\n', output);
  680. X        (void)fprintf(output.fp, "%s", C50_static), Putl(output, 0);
  681. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  682. X        Putchr('\n', output);
  683. X        (void)fprintf(output.fp, "Ne(p1, p2)\n"), Putl(output, 1);
  684. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  685. X        Putchr('{', output),Putchr('\n', output);
  686. X        (void)fprintf(output.fp, "%creturn (!Eq(p1, p2));", tab1), Putl(output, 0);
  687. X        Putchr('}', output),Putchr('\n', output);
  688. X    }
  689. X    if (usesle) {
  690. X        Putchr('\n', output);
  691. X        (void)fprintf(output.fp, "%s", C50_static), Putl(output, 0);
  692. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  693. X        Putchr('\n', output);
  694. X        (void)fprintf(output.fp, "Le(p1, p2)\n"), Putl(output, 1);
  695. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  696. X        Putchr('{', output),Putchr('\n', output);
  697. X        (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  698. X        Putchr('\n', output);
  699. X        (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  700. X        (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  701. X        (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  702. X        (void)fprintf(output.fp, "%sif ((*p1++ & ~ *p2++) != 0)\n", tab2), Putl(output, 1);
  703. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  704. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  705. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  706. X        (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  707. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  708. X        (void)fprintf(output.fp, "%cwhile (i != 0) {\n", tab1), Putl(output, 1);
  709. X        (void)fprintf(output.fp, "%sif (*p1++ != 0)\n", tab2), Putl(output, 1);
  710. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  711. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  712. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  713. X        (void)fprintf(output.fp, "%si--;\n", tab2), Putl(output, 1);
  714. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  715. X        (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  716. X        printid(defnams.A[(int)(dtrue)]->U.V6.lid);
  717. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  718. X        Putchr('}', output),Putchr('\n', output);
  719. X    }
  720. X    if (usesge) {
  721. X        Putchr('\n', output);
  722. X        (void)fprintf(output.fp, "%s", C50_static), Putl(output, 0);
  723. X        printid(defnams.A[(int)(dboolean)]->U.V6.lid);
  724. X        Putchr('\n', output);
  725. X        (void)fprintf(output.fp, "Ge(p1, p2)\n"), Putl(output, 1);
  726. X        (void)fprintf(output.fp, "%c%s%s%cp1, p2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  727. X        Putchr('{', output),Putchr('\n', output);
  728. X        (void)fprintf(output.fp, "%c%s%s%ci, j;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  729. X        Putchr('\n', output);
  730. X        (void)fprintf(output.fp, "%ci = *p1++;\n", tab1), Putl(output, 1);
  731. X        (void)fprintf(output.fp, "%cj = *p2++;\n", tab1), Putl(output, 1);
  732. X        (void)fprintf(output.fp, "%cwhile (i != 0 && j != 0) {\n", tab1), Putl(output, 1);
  733. X        (void)fprintf(output.fp, "%sif ((*p2++ & ~ *p1++) != 0)\n", tab2), Putl(output, 1);
  734. X        (void)fprintf(output.fp, "%sreturn (false);\n", tab3), Putl(output, 1);
  735. X        (void)fprintf(output.fp, "%si--, j--;\n", tab2), Putl(output, 1);
  736. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  737. X        (void)fprintf(output.fp, "%cwhile (j != 0) {\n", tab1), Putl(output, 1);
  738. X        (void)fprintf(output.fp, "%sif (*p2++ != 0)\n", tab2), Putl(output, 1);
  739. X        (void)fprintf(output.fp, "%sreturn (", tab3), Putl(output, 0);
  740. X        printid(defnams.A[(int)(dfalse)]->U.V6.lid);
  741. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  742. X        (void)fprintf(output.fp, "%sj--;\n", tab2), Putl(output, 1);
  743. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  744. X        (void)fprintf(output.fp, "%creturn (", tab1), Putl(output, 0);
  745. X        printid(defnams.A[(int)(dtrue)]->U.V6.lid);
  746. X        (void)fprintf(output.fp, ");\n"), Putl(output, 1);
  747. X        Putchr('}', output),Putchr('\n', output);
  748. X    }
  749. X    if (usemksub) {
  750. X        Putchr('\n', output);
  751. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  752. X        (void)fprintf(output.fp, "Mksubr(lo, hi, sp)\n"), Putl(output, 1);
  753. X        (void)fprintf(output.fp, "%c%s%s%s%clo, hi;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  754. X        (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  755. X        Putchr('{', output),Putchr('\n', output);
  756. X        (void)fprintf(output.fp, "%c%s%s%ci, k;\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  757. X        Putchr('\n', output);
  758. X        (void)fprintf(output.fp, "%cif (hi < lo)\n", tab1), Putl(output, 1);
  759. X        (void)fprintf(output.fp, "%sreturn (sp);\n", tab2), Putl(output, 1);
  760. X        (void)fprintf(output.fp, "%ci = hi / (setbits+1) + 1;\n", tab1), Putl(output, 1);
  761. X        (void)fprintf(output.fp, "%cfor (k = *sp + 1; k <= i; k++)\n", tab1), Putl(output, 1);
  762. X        (void)fprintf(output.fp, "%ssp[k] = 0;\n", tab2), Putl(output, 1);
  763. X        (void)fprintf(output.fp, "%cif (*sp < i)\n", tab1), Putl(output, 1);
  764. X        (void)fprintf(output.fp, "%s*sp = i;\n", tab2), Putl(output, 1);
  765. X        (void)fprintf(output.fp, "%cfor (k = lo; k <= hi; k++)\n", tab1), Putl(output, 1);
  766. X        (void)fprintf(output.fp, "%ssp[k / (setbits+1) + 1] |= (1 << (k %% (setbits+1)));\n", tab2), Putl(output, 1);
  767. X        (void)fprintf(output.fp, "%creturn (sp);\n", tab1), Putl(output, 1);
  768. X        Putchr('}', output),Putchr('\n', output);
  769. X    }
  770. X    if (useins) {
  771. X        Putchr('\n', output);
  772. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  773. X        (void)fprintf(output.fp, "Insmem(m, sp)\n"), Putl(output, 1);
  774. X        (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  775. X        (void)fprintf(output.fp, "%c%s%s%csp;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  776. X        Putchr('{', output),Putchr('\n', output);
  777. X        (void)fprintf(output.fp, "%c%s%s%ci,\n", tab1, registr, inttyp, tab1), Putl(output, 1);
  778. X        (void)fprintf(output.fp, "%s%cj = m / (setbits+1) + 1;\n", tab3, tab1), Putl(output, 1);
  779. X        Putchr('\n', output);
  780. X        (void)fprintf(output.fp, "%cif (*sp < j)\n", tab1), Putl(output, 1);
  781. X        (void)fprintf(output.fp, "%sfor (i = *sp + 1, *sp = j; i <= *sp; i++)\n", tab2), Putl(output, 1);
  782. X        (void)fprintf(output.fp, "%ssp[i] = 0;\n", tab3), Putl(output, 1);
  783. X        (void)fprintf(output.fp, "%csp[j] |= (1 << (m %% (setbits+1)));\n", tab1), Putl(output, 1);
  784. X        (void)fprintf(output.fp, "%creturn (sp);\n", tab1), Putl(output, 1);
  785. X        Putchr('}', output),Putchr('\n', output);
  786. X    }
  787. X    if (usesets) {
  788. X        Putchr('\n', output);
  789. X        (void)fprintf(output.fp, "%sSETSPACE\n", ifndef), Putl(output, 1);
  790. X        (void)fprintf(output.fp, "%sSETSPACE 256\n", C4_define), Putl(output, 1);
  791. X        (void)fprintf(output.fp, "%s\n", endif), Putl(output, 1);
  792. X        (void)fprintf(output.fp, "%s%s\n", C50_static, setptyp), Putl(output, 1);
  793. X        (void)fprintf(output.fp, "Currset(n,sp)\n"), Putl(output, 1);
  794. X        (void)fprintf(output.fp, "%c%s%cn;\n", tab1, inttyp, tab1), Putl(output, 1);
  795. X        (void)fprintf(output.fp, "%c%s%csp;\n", tab1, setptyp, tab1), Putl(output, 1);
  796. X        Putchr('{', output),Putchr('\n', output);
  797. X        (void)fprintf(output.fp, "%c%s%s%cSpace[SETSPACE];\n", tab1, C50_static, setwtyp, tab1), Putl(output, 1);
  798. X        (void)fprintf(output.fp, "%c%s%s%cTop = Space;\n", tab1, C50_static, setptyp, tab1), Putl(output, 1);
  799. X        Putchr('\n', output);
  800. X        (void)fprintf(output.fp, "%cswitch (n) {\n", tab1), Putl(output, 1);
  801. X        (void)fprintf(output.fp, "%c  case 0:\n", tab1), Putl(output, 1);
  802. X        (void)fprintf(output.fp, "%sTop = Space;\n", tab2), Putl(output, 1);
  803. X        (void)fprintf(output.fp, "%sreturn (0);\n", tab2), Putl(output, 1);
  804. X        (void)fprintf(output.fp, "%c  case 1:\n", tab1), Putl(output, 1);
  805. X        (void)fprintf(output.fp, "%sif (&Space[SETSPACE] - Top <= %1d) {\n", tab2, maxsetrange), Putl(output, 1);
  806. X        (void)fprintf(output.fp, "%s%sfprintf(stderr, \"Set-space exhausted\\n\");\n", tab3, voidcast), Putl(output, 1);
  807. X        (void)fprintf(output.fp, "%sexit(1);\n", tab3), Putl(output, 1);
  808. X        (void)fprintf(output.fp, "%s}\n", tab2), Putl(output, 1);
  809. X        (void)fprintf(output.fp, "%s*Top = 0;\n", tab2), Putl(output, 1);
  810. X        (void)fprintf(output.fp, "%sreturn (Top);\n", tab2), Putl(output, 1);
  811. X        (void)fprintf(output.fp, "%c  case 2:\n", tab1), Putl(output, 1);
  812. X        (void)fprintf(output.fp, "%sif (Top <= &sp[*sp])\n", tab2), Putl(output, 1);
  813. X        (void)fprintf(output.fp, "%sTop = &sp[*sp + 1];\n", tab3), Putl(output, 1);
  814. X        (void)fprintf(output.fp, "%sreturn (sp);\n", tab2), Putl(output, 1);
  815. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  816. X        (void)fprintf(output.fp, "%c/* NOTREACHED */\n", tab1), Putl(output, 1);
  817. X        Putchr('}', output),Putchr('\n', output);
  818. X    }
  819. X    if (usescpy) {
  820. X        Putchr('\n', output);
  821. X        (void)fprintf(output.fp, "%s%s\n", C50_static, voidtyp), Putl(output, 1);
  822. X        (void)fprintf(output.fp, "Setncpy(S1, S2, N)\n"), Putl(output, 1);
  823. X        (void)fprintf(output.fp, "%c%s%s%cS1, S2;\n", tab1, registr, setptyp, tab1), Putl(output, 1);
  824. X        (void)fprintf(output.fp, "%c%s%s%s%cN;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  825. X        Putchr('{', output),Putchr('\n', output);
  826. X        (void)fprintf(output.fp, "%c%s%s%s%cm;\n", tab1, registr, usigned, inttyp, tab1), Putl(output, 1);
  827. X        Putchr('\n', output);
  828. X        (void)fprintf(output.fp, "%cN /= sizeof(%s);\n", tab1, setwtyp), Putl(output, 1);
  829. X        (void)fprintf(output.fp, "%c*S1++ = --N;\n", tab1), Putl(output, 1);
  830. X        (void)fprintf(output.fp, "%cm = *S2++;\n", tab1), Putl(output, 1);
  831. X        (void)fprintf(output.fp, "%cwhile (m != 0 && N != 0) {\n", tab1), Putl(output, 1);
  832. X        (void)fprintf(output.fp, "%s*S1++ = *S2++;\n", tab2), Putl(output, 1);
  833. X        (void)fprintf(output.fp, "%s--N;\n", tab2), Putl(output, 1);
  834. X        (void)fprintf(output.fp, "%s--m;\n", tab2), Putl(output, 1);
  835. X        (void)fprintf(output.fp, "%c}\n", tab1), Putl(output, 1);
  836. X        (void)fprintf(output.fp, "%cwhile (N-- != 0)\n", tab1), Putl(output, 1);
  837. X        (void)fprintf(output.fp, "%s*S1++ = 0;\n", tab2), Putl(output, 1);
  838. X        Putchr('}', output),Putchr('\n', output);
  839. X    }
  840. X    if (usecase) {
  841. X        Putchr('\n', output);
  842. X        (void)fprintf(output.fp, "%s%s\n", C50_static, voidtyp), Putl(output, 1);
  843. X        (void)fprintf(output.fp, "Caseerror(n)\n"), Putl(output, 1);
  844. X        (void)fprintf(output.fp, "%c%s%cn;\n", tab1, inttyp, tab1), Putl(output, 1);
  845. X        Putchr('{', output),Putchr('\n', output);
  846. X        (void)fprintf(output.fp, "%c%sfprintf(stderr, \"Missing case limb: line %%d\\n\", n);\n", tab1, voidcast), Putl(output, 1);
  847. X        (void)fprintf(output.fp, "%cexit(1);\n", tab1), Putl(output, 1);
  848. X        Putchr('}', output),Putchr('\n', output);
  849. X    }
  850. X    if (usemax) {
  851. X        Putchr('\n', output);
  852. X        (void)fprintf(output.fp, "%s%s\n", C50_static, inttyp), Putl(output, 1);
  853. X        (void)fprintf(output.fp, "Max(m, n)\n"), Putl(output, 1);
  854. X        (void)fprintf(output.fp, "%c%s%cm, n;\n", tab1, inttyp, tab1), Putl(output, 1);
  855. X        Putchr('{', output),Putchr('\n', output);
  856. X        (void)fprintf(output.fp, "%cif (m > n)\n", tab1), Putl(output, 1);
  857. X        (void)fprintf(output.fp, "%sreturn (m);\n", tab2), Putl(output, 1);
  858. X        (void)fprintf(output.fp, "%creturn (n);\n", tab1), Putl(output, 1);
  859. X        Putchr('}', output),Putchr('\n', output);
  860. X    }
  861. X    if (use(dtrunc)) {
  862. X        (void)fprintf(output.fp, "%s%s\n", C50_static, inttyp), Putl(output, 1);
  863. X        (void)fprintf(output.fp, "Trunc(f)\n"), Putl(output, 1);
  864. X        printid(defnams.A[(int)(dreal)]->U.V6.lid);
  865. X        (void)fprintf(output.fp, "%cf;\n", tab1), Putl(output, 1);
  866. X        Putchr('{', output),Putchr('\n', output);
  867. X        (void)fprintf(output.fp, "%creturn f;\n", tab1), Putl(output, 1);
  868. X        Putchr('}', output),Putchr('\n', output);
  869. X    }
  870. X    if (use(dround)) {
  871. X        (void)fprintf(output.fp, "%s%s\n", C50_static, inttyp), Putl(output, 1);
  872. X        (void)fprintf(output.fp, "Round(f)\n"), Putl(output, 1);
  873. X        printid(defnams.A[(int)(dreal)]->U.V6.lid);
  874. X        (void)fprintf(output.fp, "%cf;\n", tab1), Putl(output, 1);
  875. X        Putchr('{', output),Putchr('\n', output);
  876. X        (void)fprintf(output.fp, "%c%s%s floor();\n", tab1, xtern, doubletyp), Putl(output, 1);
  877. X        (void)fprintf(output.fp, "%creturn floor(%s(0.5+f));\n", tab1, dblcast), Putl(output, 1);
  878. X        Putchr('}', output),Putchr('\n', output);
  879. X    }
  880. X    G194_conflag = F195;
  881. X    G196_setused = F197;
  882. X    G198_dropset = F199;
  883. X    G200_donearr = F201;
  884. X    G202_doarrow = F203;
  885. X    G204_indnt = F205;
  886. X}
  887. X
  888. Xvoid initialize();
  889. X
  890. X void
  891. Xdefname(cn, str)
  892. X    cnames    cn;
  893. X    keyword    str;
  894. X{
  895. X    toknbuf    w;
  896. X    register toknidx    i;
  897. X
  898. X    {   register int    _j, _i = 1 - 1;
  899. X        for (_j = 0; _j < 10; )
  900. X        w.A[_i++] = str.A[_j++];
  901. X    }
  902. X    {
  903. X        toknidx    B67 = 1,
  904. X            B68 = keywordlen;
  905. X
  906. X        if (B67 <= B68)
  907. X            for (i = B67; ; i++) {
  908. X                if (w.A[i - 1] == space) {
  909. X                    w.A[i - 1] = null;
  910. X                    goto L999;
  911. X                }
  912. X                if (i == B68) break;
  913. X            }
  914. X    }
  915. X    w.A[keywordlen + 1 - 1] = null;
  916. XL999:
  917. X    ctable.A[(int)(cn)] = saveid(&w);
  918. X}
  919. X
  920. X void
  921. Xdefid(nt, did, str)
  922. X    treetyp    nt;
  923. X    predefs    did;
  924. X    keyword    str;
  925. X{
  926. X    toknbuf    w;
  927. X    register toknidx    i;
  928. X    treeptr    tp, tq, tv;
  929. X
  930. X    {
  931. X        toknidx    B69 = 1,
  932. X            B70 = keywordlen;
  933. X
  934. X        if (B69 <= B70)
  935. X            for (i = B69; ; i++) {
  936. X                if (str.A[i - 1] == space) {
  937. X                    w.A[i - 1] = null;
  938. X                    goto L999;
  939. X                } else
  940. X                    w.A[i - 1] = str.A[i - 1];
  941. X                if (i == B70) break;
  942. X            }
  943. X    }
  944. X    w.A[keywordlen + 1 - 1] = null;
  945. XL999:
  946. X    tp = newid(saveid(&w));
  947. X    defnams.A[(int)(did)] = tp->U.V43.tsym;
  948. X    if (Member((unsigned)(nt), Conset[162])) {
  949. X        tv = mknode(npredef);
  950. X        tv->U.V12.tdef = did;
  951. X        tv->U.V12.tobtyp = tnone;
  952. X    } else
  953. X        tv = (struct S61 *)NIL;
  954. X    switch (nt) {
  955. X      case nscalar:
  956. X        tv = mknode(nscalar);
  957. X        tv->U.V17.tscalid = (struct S61 *)NIL;
  958. X        tq = mknode(ntype);
  959. X        tq->U.V14.tbind = tv;
  960. X        tq->U.V14.tidl = tp;
  961. X        tp = tq;
  962. X        break ;
  963. X      case nconst:  case ntype:  case nfield:  case nvar:
  964. X        tq = mknode(nt);
  965. X        tq->U.V14.tbind = tv;
  966. X        tq->U.V14.tidl = tp;
  967. X        tq->U.V14.tattr = anone;
  968. X        tp = tq;
  969. X        break ;
  970. X      case nfunc:  case nproc:
  971. X        tq = mknode(nt);
  972. X        tq->U.V13.tsubid = tp;
  973. X        tq->U.V13.tsubstmt = tv;
  974. X        tq->U.V13.tfuntyp = (struct S61 *)NIL;
  975. X        tq->U.V13.tsubpar = (struct S61 *)NIL;
  976. X        tq->U.V13.tsublab = (struct S61 *)NIL;
  977. X        tq->U.V13.tsubconst = (struct S61 *)NIL;
  978. X        tq->U.V13.tsubtype = (struct S61 *)NIL;
  979. X        tq->U.V13.tsubvar = (struct S61 *)NIL;
  980. X        tq->U.V13.tsubsub = (struct S61 *)NIL;
  981. X        tq->U.V13.tscope = (struct S60 *)NIL;
  982. X        tq->U.V13.tstat = 0;
  983. X        tp = tq;
  984. X        break ;
  985. X      case nid:
  986. X        break ;
  987. X      default:
  988. X        Caseerror(Line);
  989. X    }
  990. X    deftab.A[(int)(did)] = tp;
  991. X}
  992. X
  993. X void
  994. Xdefkey(s, w)
  995. X    symtyp    s;
  996. X    keyword    w;
  997. X{
  998. X    register unsigned char    i;
  999. X
  1000. X    {
  1001. X        unsigned char    B71 = 1,
  1002. X            B72 = keywordlen;
  1003. X
  1004. X        if (B71 <= B72)
  1005. X            for (i = B71; ; i++) {
  1006. X                if (w.A[i - 1] == space)
  1007. X                    w.A[i - 1] = null;
  1008. X                if (i == B72) break;
  1009. X            }
  1010. X    }
  1011. X    {
  1012. X        register struct S206 *W73 = &keytab.A[(unsigned)(s)];
  1013. X
  1014. X        W73->wrd = w;
  1015. X        W73->sym = s;
  1016. X    }
  1017. X}
  1018. X
  1019. X void
  1020. Xfixinit(i)
  1021. X    strindx    i;
  1022. X{
  1023. X    toknbuf    t;
  1024. X
  1025. X    gettokn(i, &t);
  1026. X    t.A[1 - 1] = 'i';
  1027. X    puttokn(i, &t);
  1028. X}
  1029. X
  1030. END_OF_FILE
  1031. if test 44980 -ne `wc -c <'ptc.c.6'`; then
  1032.     echo shar: \"'ptc.c.6'\" unpacked with wrong size!
  1033. fi
  1034. # end of 'ptc.c.6'
  1035. fi
  1036. echo shar: End of archive 8 \(of 12\).
  1037. cp /dev/null ark8isdone
  1038. MISSING=""
  1039. for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
  1040.     if test ! -f ark${I}isdone ; then
  1041.     MISSING="${MISSING} ${I}"
  1042.     fi
  1043. done
  1044. if test "${MISSING}" = "" ; then
  1045.     echo You have unpacked all 12 archives.
  1046.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1047. else
  1048.     echo You still need to unpack the following archives:
  1049.     echo "        " ${MISSING}
  1050. fi
  1051. ##  End of shell archive.
  1052. exit 0
  1053. -- 
  1054.  
  1055. Rich $alz            "Anger is an energy"
  1056. Cronus Project, BBN Labs    rsalz@bbn.com
  1057. Moderator, comp.sources.unix    sources@uunet.uu.net
  1058.